cmake_minimum_required(VERSION 3.15.3)
project(algorithm CXX C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_DEBUG_POSTFIX "_d")
set(CMAKE_RELEASE_POSTFIX "_r")
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/build/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${PROJECT_SOURCE_DIR}/build/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${PROJECT_SOURCE_DIR}/build/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_SOURCE_DIR}/build/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/build/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/build/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE  ${PROJECT_SOURCE_DIR}/build/bin)

include_directories(
    ${PROJECT_SOURCE_DIR}/googletest/include
    ${PROJECT_SOURCE_DIR}/include
)
# 添加下级目录，生成.a文件
add_subdirectory("${PROJECT_SOURCE_DIR}/googletest")
add_subdirectory("src/ds/list")


add_executable(${PROJECT_NAME} src/main.c)

#添加连接库依赖
target_link_libraries(${PROJECT_NAME} llist)



#添加测试执行程序

add_executable(all_test
        ${PROJECT_SOURCE_DIR}/test/main.cpp
        ${PROJECT_SOURCE_DIR}/src/ds/list/list_test.cxx)
target_link_libraries(all_test gtest)














